<template>
  <div>
    <el-table
      :height="tableHeight"
      class="mt-2"
      stripe
      v-loading="loading"
      :data="rows"
    >
      <!-- <el-table-column prop="id" label="ID" width="180"> </el-table-column> -->

      <el-table-column prop="id" label="序号" width="120"> </el-table-column>
      <el-table-column prop="displayName" label="昵称" width="240">
      </el-table-column>
      <!-- <el-table-column prop="name" label="用户名"> </el-table-column>
      <el-table-column prop="mobile" label="手机号"> </el-table-column> -->
      <el-table-column prop="uid" label="用户ID"> </el-table-column>

      <el-table-column label="操作" width="160">
        <template slot-scope="{ row }">
          <el-button @click="unblock(row)" size="small">解封</el-button>
        </template>
      </el-table-column>
    </el-table>
    <the-page ref="page" @change="fetch" />
    <this-edit ref="edit" @edited="fetch" />
    <this-add ref="add" @added="fetch" />
  </div>
</template>

<script>
import rowsCurl from "@/mixins/rows-curl";
import thisEdit from "./edit.vue";
import thisAdd from "./add.vue";
import thePage from "@/components/page.vue";
import thisSearch from "./search.vue";

export default {
  components: { thisEdit, thisAdd, thisSearch, thePage },
  mixins: [rowsCurl],
  data() {
    return {
      uri: {
        list: "user/getBlockList",
      },
    };
  },
  computed: {},
  methods: {
    unblock(row) {
      this.axios
        .post("/user/updateUserStatus", {
          status: 0,
          userId: row.uid,
        })
        .then((res) => {
          if (res.retCode != 0) {
            return this.$message.error(res.retMsg);
          }
          this.fetch(1);
          this.$message.success("操作成功!");
          // this.loading = false;
        });
    },
  },
};
</script>

<style>
</style>